package com.platform.enums;

import com.platform.comm.constants.EnumOption;
import com.platform.comm.enums.IDictEntry;
import com.platform.comm.enums.IEnumItem;
import com.platform.comm.enums.IEnumOption;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 台账类别
 * @author zq
 */
@EnumOption(name = "ledgerType")
public enum LedgerType implements IDictEntry, IEnumItem, IEnumOption<String> {
    /**
     * 台账类型
     */
    XZCF("1", "行政处罚"),
    XZXK("2", "行政许可");

    LedgerType(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public final String name;
    public final String desc;

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String key() {
        return name;
    }

    @Override
    public String value() {
        return desc;
    }

    @Override
    public Map<String, String> enums() {
        return Arrays.stream(values()).collect(Collectors.toMap(IEnumOption::key, IEnumOption::value));
    }

    @Override
    public String getKey() {
        return name;
    }

    @Override
    public String getValue() {
        return desc;
    }

    @Override
    public Object getData() {
        return this;
    }

    @Override
    public boolean is(String code) {
        return false;
    }
}
